const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi");
const {
  add_cate_schema,
  delete_cate_schema,
  get_cate_schema,
  update_cate_schema,
} = require("../schema/artcate");
const articate = require("./artcate/artcate");

router.get("/cates", articate.getArtiCates);
router.post("/addcates", expressJoi(add_cate_schema), articate.addArticleCates);
router.get(
  "/deletecate/:id",
  expressJoi(delete_cate_schema),
  articate.deleteCateById
);
router.get("/cates/:id", expressJoi(get_cate_schema), articate.getArticleById);
router.post(
  "/updatecate",
  expressJoi(update_cate_schema),
  articate.updateCateById
);

module.exports = router;
